package com.example.wechat_b.activity;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.example.wechat_b.R;
import com.example.wechat_b.activity.base.BaseActivity;

public class FriendActivity extends BaseActivity {

    private ImageView solid,back;
    private RelativeLayout ac_fri_lin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        //注意要清除 FLAG_TRANSLUCENT_STATUS flag
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        getWindow().setStatusBarColor(getResources().getColor(R.color.min_gray));
        setContentView(R.layout.activity_friend);
        ActionBar bar = getSupportActionBar();
        if (bar.isShowing()) {
            bar.hide();
        }
        setContentView(R.layout.activity_friend);

        init();
        initEvent();
    }

    private void init() {
        solid = findViewById(R.id.chat_bar_solid);
        ac_fri_lin = findViewById(R.id.ac_fri_lin);
        back = findViewById(R.id.chat_bar_img);
    }

    private void initEvent() {
        if (solid.getVisibility()!= View.VISIBLE){
            solid.setVisibility(View.VISIBLE);
        }
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FriendActivity.this.finish();
            }
        });
        ac_fri_lin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(FriendActivity.this,ChatActivity.class);
                intent.putExtra("name","辛集朋");
                startActivity(intent);
                FriendActivity.this.finish();
            }
        });
    }
}